/**
* Copyright (c) 2022 - present TinyVue Authors.
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

@import '../mixins/hairline.less';
@import '../mixins/common.less';
@import '../custom.less';
@import './vars.less';

@file-upload-prefix-cls: ~'@{css-prefix}mobile-file-upload';
@upload-prefix-cls: ~'@{css-prefix}upload';
@svg-prefix-cls: ~'@{css-prefix}svg';

.@{file-upload-prefix-cls} {
  &__header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 12px;
    .hairline('bottom', var(--ti-mobile-file-upload-hairline-color, #ddd));

    &-title {
      flex: 1;
      color: var(--ti-mobile-file-upload-title-color, #333);
      font-size: var(--ti-mobile-file-upload-font-size, 16px);
    }

    &-upload {
      display: flex;
      align-items: center;
    }

    .upload-icon {
      .@{svg-prefix-cls} {
        font-size: var(--ti-mobile-file-upload-icon-size, 24px);
        fill: var(--ti-mobile-file-upload-icon-color, #999);
      }
    }
  }

  &__wrap.is-card {
    padding-left: 16px;
    .clearfix();
  }

  .upload-status {
    color: var(--ti-mobile-file-upload-status-color, #999);
    font-size: var(--ti-mobile-file-upload-status-font-size, 12px);
    margin-right: 10px;

    .@{svg-prefix-cls} {
      font-size: var(--ti-mobile-file-upload-icon-size, 24px);
      fill: var(--ti-mobile-file-upload-icon-color, #999);
    }
  }

  .@{upload-prefix-cls} {
    display: inline-block;
    text-align: center;
    cursor: pointer;
    outline: 0;
  }

  .@{upload-prefix-cls}--picture-card {
    width: var(--ti-mobile-file-upload-picture-card-size, 64px);
    height: var(--ti-mobile-file-upload-picture-card-size, 64px);
    line-height: var(--ti-mobile-file-upload-picture-card-size, 64px);
    border: 1px solid var(--ti-mobile-file-upload-picture-card-border-color, #ccc);
    background-color: var(--ti-mobile-file-upload-picture-card-bgcolor, #fff);
    border-radius: 0;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    outline: 0;

    svg {
      font-size: 28px;
      fill: #8c939d;
    }

    &:hover,
    &:focus {
      border-color: var(--ti-mobile-file-upload-picture-card-border-color, #ccc);
    }
  }
}

[class*=~'@{css-prefix}'] {
  input[type='file'] {
    display: none;
  }
}
